/*= -*- c++ -*- ===============================================================
FILE: CTextParser.h

Text parser.
=============================================================================*/
#ifndef __CTEXTPARSER_H__
#define __CTEXTPARSER_H__

#include "stdTypes.h"
#include "CGraphicFont.h"


class CTextParser
{
public:
	                         CTextParser();
	virtual                  ~CTextParser();

	void                     Parse(const CGraphicFont *pFont,const AECHAR *pwszContent,int width);

	int                      GetNumLines() const;
	const AECHAR *           GetTextPtrForLine( int line ) const;
	int                      GetIndexForLine( int line ) const;
	int                      GetNumCharsForLine( int line ) const;
	
protected:
	int                      ParseLine( int idx, int charsFit );
    eFontTextTokenType       GetTokenType( AECHAR c );
	// content information
	const CGraphicFont *     m_pFont;                 // owned by parent - DO NOT DELETE 
	const AECHAR *           m_pwszContent;           // owned by parent - DO NOT DELETE
	int                      m_width;

	// calculated info
	int                      m_numLines;
	int32					 m_lineInfoVector[200];

private:
	// disable default copy constructor and assignment operator
	                         CTextParser( const CTextParser &source ); 
	CTextParser &            operator=( const CTextParser &source );
};


#endif	// #ifndef __CTEXTPARSER_H__
